package day12.KeJian;

import java.io.*;

public class Tset15 {
    public static void main(String[] args) throws IOException {
        //复制视频
        //m1();
        m2();
    }
    //字节缓冲流一次读写一个字节数组
    private static void m2() throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("D://itheima//00-基础班大纲介绍.wmv"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("D://itheima//aa//00-基础班大纲介绍.wmv"));
        byte[] bys = new byte[1024];
        int len;
        while ((len=bis.read(bys))!=-1){
            bos.write(bys,0,len);
        }
        bis.close();
        bos.close();
    }
    //字节缓冲流一次读写一个字节
    private static void m1() throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("D://itheima//00-基础班大纲介绍.wmv"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("D://itheima//aa//00-基础班大纲介绍.wmv"));
        int by;
        while ((by=bis.read())!=-1){
            bos.write(by);
        }
        bos.close();
        bis.close();
    }
}
